#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
	int inf, outf;
	int l;
	char buf[4096];
	
	inf=open("source.c",O_RDONLY,0400);
        outf=open("dest.c",O_WRONLY,0600);
	printf("inf is %d,ouf is %d\n",inf,outf);
       do {
	       l=read(inf,buf,4096);
	       write(outf,buf,l);
       } while (l);
       close(outf);
       close(inf);

       return 0;
}
